namespace Front._1120;

public partial class Form2 : Form
{
    public Form2()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        openFileDialog1 =  new OpenFileDialog();
        if (openFileDialog1.ShowDialog() == DialogResult.OK)
        {
            File.Copy(openFileDialog1.FileName,"D:\\1120\\"+Path.GetFileName(openFileDialog1.FileName));
        }
    }

    private void button3_Click(object sender, EventArgs e)
    {
        openFileDialog1 = new OpenFileDialog();
        if (openFileDialog1.ShowDialog()==DialogResult.OK)
        {
            string path = openFileDialog1.FileName;
            string strFileName = Path.GetFileName(path);
            
            string uuid = Guid.NewGuid().ToString();
            
            long time = DateTime.Now.Ticks;
            
            File.Copy(path,"D:\\1120\\"+uuid+"_"+time+"_"+strFileName);
            this.pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
        }
    }

    private void button2_Click(object sender, EventArgs e)
    {
        var saveFileDialog1 = new SaveFileDialog();
        if (saveFileDialog1.ShowDialog() == DialogResult.OK)
        {
            string str = "hello world";
            File.WriteAllText(saveFileDialog1.FileName, str);
        }
    }
}